package com.example.questionnaire.controller;


import com.example.questionnaire.entity.Admin;
import com.example.questionnaire.mapper.AdminMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author autoGenerate
 * @since 2022-10-30
 */
@Controller
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    AdminMapper adminMapper;

    /**
     *如下代码为例，程序启动后访问8080/admin/findAll，会返回查询结果
     */
    @RequestMapping("/findAll")
    @ResponseBody
    public List<Admin> findAll(){
        return adminMapper.findAll();
    }

}

